

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>The Source Code Viewer [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Source Code,Source Code Viewer,Source Code File Parsing In Source Code Viewer,Source Code Editor,Source Code Display In Source Code Viewer,Source Code Toolbar Buttons,DDL,DDL Display In Source Code Viewer,Parse,Parse Source Code Files In Viewer">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">The Source Code Viewer</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="favorites.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="the_scripter_window.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_BodyText"><span class="f_BodyText">The </span><span class="f_UIControl">Source Code</span><span class="f_BodyText"> viewer can be used to view any source code you are opening. If a Class is selected, it shows the source code for that Class, provided it has already been <a href="generatesourcecode.htm">generated</a>. For C++ a second tab displays to show the implementation file.</span></p>
<p class="p_BodyText"><span class="f_BodyText">A number of options change the way the </span><span class="f_UIControl">Source Code</span><span class="f_BodyText"> viewer works. They can be altered via the </span><span class="f_UIControl">Options</span><span class="f_BodyText"> dialog (select the </span><span class="f_MenuKeyField">Tools | Options</span><span class="f_BodyText"> </span><span class="f_MenuKeyField">| Source Code Engineering | Code Editors</span><span class="f_BodyText"> menu option)</span><span class="f_BodyText">.</span></p>
<p class="p_BodyText"><span class="f_BodyText">By default the </span><span class="f_UIControl">Source Code</span><span class="f_BodyText"> viewer is set to:</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">Parse all opened files, and show a tree of the results</span></li>
<li><span class="f_Bulletlist1">Show line numbers</span></li>
<li><span class="f_Bulletlist1">Have outlining enabled.</span></li>
</ul>
<p class="p_BodyText"><span class="f_BodyText">The </span><span class="f_UIControl">Source Code</span><span class="f_BodyText"> viewer also displays any DDL generated for a selected table in your diagram.</span></p>
<p class="p_SubHeadingL1"><a name="external"></a><span class="f_SubHeadingL1">External File Editor</span></p>
<p class="p_BodyText"><span class="f_BodyText">A very similar code editor for editing external </span><span class="f_Tabletext">code, XML and DDL files </span><span class="f_BodyText">(that is, code not selected from the </span><span class="f_UIControl">Project Browser</span><span class="f_BodyText">) is available through the </span><span class="f_MenuKeyField">File | Open Source File</span><span class="f_BodyText"> menu option, or by pressing </span><span class="f_MenuKeyField">[Ctrl]+[Alt]+[O]</span><span class="f_BodyText">. This editor does not have a toolbar; basic editing options are available through a right-click context menu. </span></p>
<p class="p_BodyText"><span class="f_BodyText">To save changes, press </span><span class="f_MenuKeyField">[Ctrl]+[S]</span><span class="f_BodyText">; also, if you try to close the window or select another file, the editor prompts you to save your changes.</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">File Parsing</span></p>
<p class="p_BodyText"><span class="f_BodyText">The </span><span class="f_UIControl">Source Code</span><span class="f_BodyText"> viewer parses files for a number of reasons. The first is to enable it to jump to the location in the file at which the currently selected item is found.</span></p>
<p class="p_BodyText"><span class="f_BodyText">Additionally, parsing displays a structure tree showing an overview of the file in a similar fashion to the main </span><span class="f_UIControl">Project Browser</span><span class="f_BodyText">. You can also select anything in that and jump to the appropriate line in the editor.</span></p>
<p class="p_BodyText"><span class="f_BodyText">The viewer cannot parse DDL, and therefore does not show the structure tree for a DDL file.</span></p>
<p class="p_TextIndentedL2"><img src="sourcecodeviewer.png" width="762" height="356" border="0" alt="SourceCodeViewer"></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">The Source Code Viewer Toolbar Buttons</span></p>
<p class="p_BodyText"><span class="f_BodyText">The toolbar buttons in the </span><span class="f_UIControl">Source Code</span><span class="f_BodyText"> viewer enable you to edit, view and interact with the code contained in the </span><span class="f_UIControl">Source Code</span><span class="f_BodyText"> viewer. The function of each button is described below:</span></p>
<p class="p_TextIndentedL2"><img src="sourcetool.png" width="272" height="30" border="0" alt="SourceTool"></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Open</span><span class="f_Bulletlist1"> button - opens the source code from an existing file, this option is also active in the 'Lite', read-only version of Enterprise Architect</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Save</span><span class="f_Bulletlist1"> button - saves the changes to the currently loaded source code; this option is also active in the 'Lite', read-only version of Enterprise Architect</span></li>
<li><span class="f_MenuKeyField">Copy</span><span class="f_Bulletlist1"> button - copies the highlighted text to the clipboard</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Paste</span><span class="f_Bulletlist1"> button - pastes the text that is currently contained in the clipboard to the </span><span class="f_UIControl">Source Code</span><span class="f_Bulletlist1"> viewer</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Undo</span><span class="f_Bulletlist1"> button - cancels the previous action</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Generate and Synch</span><span class="f_Bulletlist1"> button - generates and synchronizes with the current object source</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Save and Resynch</span><span class="f_Bulletlist1"> button - saves the source code and resynchronizes the Class</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Code Templates</span><span class="f_Bulletlist1"> button - accesses the </span><span class="f_UIControl"><a href="codetemplates.htm">Code Templates Editor</a></span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Build and Run</span><span class="f_Bulletlist1"> button - provides quick access to the following commands:</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 65px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Build</span><span class="f_Bulletlist3"> - run package build scripts</span></li>
<li><span class="f_MenuKeyField">Test</span><span class="f_Bulletlist3"> - run package test scripts</span></li>
<li><span class="f_MenuKeyField">Run</span><span class="f_Bulletlist3"> - run debug</span></li>
<li><span class="f_MenuKeyField">Package Build Scripts</span><span class="f_Bulletlist3"> - configure package build scripts</span></li>
</ul>
<p class="p_Bulletlist3"><span class="f_Bulletlist3">(these options are also active in the 'Lite', read-only version of Enterprise Architect)</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_MenuKeyField">Set Font</span><span class="f_Bulletlist1"> button - sets the font for the text contained in the </span><span class="f_UIControl">Source Code </span><span class="f_Bulletlist1">viewer.</span></li>
</ul>




            </div>
          </div>
        </div>



</div>


</body>
</html>
